import axios from "@/api/request"


const meal = {
    add: "/back/meal/add",
    update: "/back/meal/update",
    delete: "/back/meal/delete",
    findById: "/back/meal/findById",
    findAll: "/back/meal/findAll",
    search: "/back/meal/search",
}
const foodItem = {
    add: "/back/foodItem/add",
    update: "/back/foodItem/update",
    delete: "/back/foodItem/delete",
    findById: "/back/foodItem/findById",
    findAll: "/back/foodItem/findAll",
    search: "/back/foodItem/search",
    searchByMealId: "/back/foodItem/searchByMealId",
}
const mealRecord = {
    add: "/back/mealRecord/add",
    update: "/back/mealRecord/update",
    delete: "/back/mealRecord/delete",
    findById: "/back/mealRecord/findById",
    findAll: "/back/mealRecord/findAll",
    search: "/back/mealRecord/search",
}

const api = {
    meal_add(params) {
        return axios.post(meal.add, params)
    },
    meal_update(params) {
        return axios.post(meal.update, params)
    },
    meal_delete(params) {
        return axios.delete(meal.delete, {params})
    },
    meal_findById(params) {
        return axios.get(meal.findById, {params})
    },
    meal_findAll(params) {
        return axios.get(meal.findAll, {params})
    },
    meal_search(params) {
        return axios.get(meal.search, {params})
    },

    foodItem_add(params) {
        return axios.post(foodItem.add, params)
    },
    foodItem_update(params) {
        return axios.post(foodItem.update, params)
    },
    foodItem_delete(params) {
        return axios.delete(foodItem.delete, {params})
    },
    foodItem_findById(params) {
        return axios.get(foodItem.findById, {params})
    },
    foodItem_findAll(params) {
        return axios.get(foodItem.findAll, {params})
    },
    foodItem_search(params) {
        return axios.get(foodItem.search, {params})
    },
    foodItem_searchByMealId(params) {
        return axios.get(foodItem.searchByMealId, {params})
    },



    mealRecord_add(params) {
        return axios.post(mealRecord.add, params)
    },
    mealRecord_update(params) {
        return axios.post(mealRecord.update, params)
    },
    mealRecord_delete(params) {
        return axios.delete(mealRecord.delete, {params})
    },
    mealRecord_findById(params) {
        return axios.get(mealRecord.findById, {params})
    },
    mealRecord_findAll(params) {
        return axios.get(mealRecord.findAll, {params})
    },
    mealRecord_search(params) {
        return axios.get(mealRecord.search, {params})
    },





}
export default api
